package org.example.jiap.bk.service.Impl;

import org.example.jiap.bk.mapper.JiapBookDetailMapper;
import org.example.jiap.bk.model.pojo.JiapBookDetailPOJO;
import org.example.jiap.bk.service.JiapBookDetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class JiapBookDetailServiceImpl implements JiapBookDetailService {
    @Resource
    private JiapBookDetailMapper jiapBookDetailMapper;

    @Override
    public void bookregister(JiapBookDetailPOJO jiapbkdetPOJO) {
        System.out.println(jiapbkdetPOJO.getId() + jiapbkdetPOJO.getBookName() + jiapbkdetPOJO.getIsDel() + jiapbkdetPOJO.getDescribeBook() +
                jiapbkdetPOJO.getCreateTime() + jiapbkdetPOJO.getClassify() + jiapbkdetPOJO.getCreateUser());

        jiapBookDetailMapper.bookdetail_insert(jiapbkdetPOJO);

        System.out.println("图书添加成功");
    }

    @Override
    public void bkremove(JiapBookDetailPOJO jiapbkdetPOJO) {
        System.out.println(jiapbkdetPOJO.getId());
        jiapBookDetailMapper.bookdetail_delete(jiapbkdetPOJO);
        System.out.println("图书删除成功");
    }

    @Override
    public void bkalter(JiapBookDetailPOJO jiapbkdetPOJO) {
        System.out.println(jiapbkdetPOJO.getId());
        jiapBookDetailMapper.bookdetail_update(jiapbkdetPOJO);
        System.out.println("图书修改成功");
    }

    @Override
    public void bkchaxun(JiapBookDetailPOJO jiapbkdetPOJO) {
        System.out.println(jiapbkdetPOJO.getId());
        jiapBookDetailMapper.bookdetail_select(jiapbkdetPOJO);
        System.out.println("图书查询成功");
    }
}
